package com.info3k.client.components;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;

public class InfoWindow extends GlassDialogBox {
	
	private HTML textMessage = new HTML();
	
	public InfoWindow(){
		panel.setWidth("200px");
		panel.setCellHorizontalAlignment(content, HorizontalPanel.ALIGN_CENTER);
		panel.setCellHorizontalAlignment(footer, HorizontalPanel.ALIGN_CENTER);
		content.add(textMessage);
		footer.add(closeButton);
		textMessage.setWidth("200px");
	}
	
	public void show(String title, String text){
		setText(title);
		textMessage.setHTML(text);
		center();
		closeButton.setFocus(true);
	}
	
	public static void showMessage(String title, String text){
		InfoWindow infoWindow = new InfoWindow();
		infoWindow.show(title, text);
	}
}
